Learn R Programming

pchc (version 1.2)

ROC and AUC: ROC and AUC

Description

Receiver operating curve and area under the curve.

Usage

auc(group, preds, roc = FALSE, cutoffs = NULL)

Value

A list including:

cutoffs

The cutoff values.

sensitivity

The sensitivity values for each cutoff value.

specificity

The specificity value for each cutoff value.

youden

The pair of of 1- specificity and sensitivity where the Youden's J appears on the graph and the Youden index which is defined as the maximum value of sensitivity - specificity + 1.

auc

The area under the curve, plus a circle with the point where Youden's J is located. If "roc" is set to FALSE, this is the only item in the list to be returned.

Arguments

group

A numerical vector with the predicted values of each group as 0 and 1.

preds

The predicted values of each group.

roc

If you want the ROC to appear set it to TRUE.

cutoffs

If you provide a vector with decreasing numbers from 1 to 0 that will be used for the ROC, otherwise, the values from 1 to 0 with a step equal to -0.01 will be used.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

The ara under the curve is returned. The user has the option of getting the receiver operating curve as well.

See Also

bn.skel.utils, conf.edge.lower, mmhc.skel

Examples

Run this code
g <- rbinom(150, 1, 0.6)
f <- rnorm(150)
pchc::auc(g, f, roc = FALSE)

Run the code above in your browser using DataLab